<?php
/**
 * Created by PhpStorm.
 * User: andrei
 * Date: Jun 27, 2012
 * Time: 4:33:26 PM
 * To change this template use File | Settings | File Templates.
 */
 
class Db_Products_MemoryListProductPageImages extends Common {
	protected static $tableName = TAB_MEMORY_LIST_PRODUCT_PAGE_IMAGES;
	protected static $dbFields = array(
        'id',
		'mppi_memory_product_page_id',
		'mppi_layout_item_id',
		'mppi_photo_id',
		'mppi_iw',
		'mppi_ih',
		'mppi_ir',
		'mppi_ix',
		'mppi_iy',
		'mppi_image_filter',
		'mppi_rotation',
		'mppi_width',
		'mppi_height',
		'mppi_x',
		'mppi_y',
        'deleted'
	);


	/**
	 * @var Db_Products_MemoryListProductPageImages
	 */
	public $objectArray;

	public $id;
	public $mppi_memory_product_page_id;
	public $mppi_layout_item_id;
	public $mppi_photo_id;
	public $mppi_iw;
	public $mppi_ih;
	public $mppi_ir;
	public $mppi_ix;
	public $mppi_iy;
	public $mppi_image_filter;
	public $mppi_rotation;
	public $mppi_width;
	public $mppi_height;
	public $mppi_x;
	public $mppi_y;
    public $deleted;

    function __construct($value=NULL, $fieldName=NULL) {
        parent::__construct($value, $fieldName);
    }

	public static function deleteByLiIds($liIds = array()) {
		$liIdsList = implode(',', $liIds);
		self::$DB->q("DELETE FROM ?f WHERE `mppi_layout_item_id` IN( ? )", self::$tableName, $liIdsList);

        return (self::$DB->affectedRows() ? true : false);
	}

}